home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / admin / linkcheck_main.php < prev    next >
Encoding:
PHP Script  |  2002-10-28  |  2.5 KB  |  112 lines

  1. <?
  2. // *******************************************************************
  3. //  admin/linkcheck_main.php
  4. // *******************************************************************
  5.  
  6. include("../include/config.php");
  7. include("../include/functions.php");
  8.  
  9. include("../include/common.php");
  10. $language = $gl["Language"];
  11.  
  12. include("../include/lang/$language.php");
  13.  
  14. include("../include/session.php");
  15. session_start();
  16.  
  17. if(!isset($start)){
  18.     $start=0;
  19. }
  20.  
  21. if(!isset($many)){
  22.     $many=10;
  23. }
  24.  
  25. ?>
  26. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  27. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  28. <html>
  29. <head>
  30. <link rel = "stylesheet" type = "text/css" href = "style.css" />
  31. <script language="javascript">
  32. function openwindow(link,h,w)
  33. {
  34.     toploc = screen.height/2 - h/2;
  35.     leftloc = screen.width/2 - w/2; 
  36.     window.open(link,"popwindow1","width=" + w + ",height=" + h + ",top=" + toploc + ",left=" + leftloc + ",scrollbars=yes,location=no,resizable=yes");
  37. }
  38. </script>
  39. <title></title>
  40. </head>
  41. <?=$adm_body?><?
  42.  
  43. if(isset($delete)){
  44.  
  45.     while($ID){
  46.  
  47.         $delete = sql_query("
  48.             delete from
  49.                 $tb_links
  50.             where
  51.                 ID='$ID'
  52.         ");
  53.  
  54.         echo "Site ID " . $ID . " has been deleted.<br>\n";
  55.     }
  56. } else {
  57.  
  58. ?><form method="post" action="linkcheck_main.php?<?=session_name()?>=<?=session_id()?>">
  59. <table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  60. <tr>
  61.     <td class="theader" width="1%">Delete</td>
  62.     <td class="theader" width="1%">Edit</td>
  63.     <td class="theader" width="98%">Site</td>
  64. </tr><?
  65.  
  66. $query = sql_query("
  67.     select
  68.         *
  69.     from
  70.         $tb_links
  71.     order by
  72.         ID
  73.     limit
  74.         $start, $many
  75. ");
  76.  
  77. $count = sql_num_rows($query);
  78.  
  79. while($rows = sql_fetch_array($query)){
  80.  
  81.     if(substr($rows[SiteURL], 0, 6) != "ftp://"){
  82.  
  83.         if(!$open = @fopen($rows[SiteURL], "r")){
  84.             $bad_link = 1;
  85.         }
  86.     }
  87.  
  88.     echo "<tr><td align=\"right\"><input class=\"small\" type=\"checkbox\" name=\"ID[]\"";
  89.     
  90.     if(isset($bad_link)){
  91.         echo " checked";
  92.     }
  93.  
  94.     unset($bad_link);
  95.     
  96.     echo "></td><td><a ";
  97.     echo "href=\"javascript:openwindow('edit_site.php?" . session_name() . "=";
  98.     echo session_id() . "&ID=" . $rows[ID];
  99.     echo "&p=1',420,520);\">Edit</a></td><td class=\"text\">";
  100.     echo "<a href=\"" . $rows[SiteURL];
  101.     echo "\" target=\"_blank\">";
  102.     echo stripslashes($rows[SiteName]) . "</a> - " . $rows[SiteURL];
  103.     echo $error_message . "</td></tr>";
  104. }
  105.  
  106. ?><tr><td colspan="3"><input class="button" type="submit" name="delete" value =" Delete Sites "></td></tr>
  107. </table></form><?
  108. }
  109. ?>
  110. </body>
  111. </html>
  112.